package com.qk.management.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qk.dto.course.CourseQueryDTO;
import com.qk.entity.Course;
import com.qk.vo.course.CourseQueryVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author:zhengbowen
 * @Date: 2025/10/06 16:16
 * @Description:
 */
@Mapper
public interface CourseMapper extends BaseMapper<Course> {


    @Select("select * from course where id = #{id}")
    Course selectCourseById(Integer id);


    void insertCourse(Course course);

    @Select("delete from course where id = #{id}")
    void deleteCourse(Integer id);

    @Select("select * from course where subject = #{subject}")
    List<Course> selectCoursesBySubject(Integer subject);

    @Select("select * from course")
    List<Course> selectCourses();

    List<CourseQueryVO> selectCoursesByPage(CourseQueryDTO courseQueryDTO);
}
